You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > Regress Class > Regress Methods > LogisticRegress Method > Regress.LogisticRegress Method ([In] TVec, [In] TVec, [In] TVec, [In] TMtx, double, [In] TVec, [In] TVec, double)
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
Regress.LogisticRegress Method ([In] TVec, [In] TVec, [In] TVec, [In] TMtx, double, [In] TVec, [In] TVec, double)

Logistic regression.

Syntax
C#
Visual Basic
public static void LogisticRegress([In] TVec y, [In] TVec n, [In] TVec b, [In] TMtx A, double Offset, [In] TVec YCalc, [In] TVec BStd, double Tolerance);
Parameters 
Description 
[In] TVec y 
response vector containing binomial counts. 
[In] TVec n 
number of trials for each count. Y is assumed to be binomial(p,N). 
[In] TVec b 
regression parameter estimates. 
[In] TMtx A 
matrix of covariates, including the constant vector if required. 
double Offset 
offset if required. 
[In] TVec YCalc 
fitted values. 
[In] TVec BStd 
Regression parameter estimates errors.This is an estimate of the precision of the B estimates. 
double Tolerance 
Default precision for reweighted LQR. 

Fit logistic regression model.

The following example calculates coefficients for simple logistic regression. The counts are out of 10 in each case and there is one covariate[1].

using Dew.Math; using Dew.Stats; using Dew.Math.Units; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { Vector y = new Vector(0); Vector n = new Vector(0); Vector B = new Vector(0); y.SetIt(false, new double[] { 2, 0, 3, 1, 5, 5, 6, 9, 5, 9 }); n.Size(y); n.SetVal(10.0); Regress.LogisticRegress(y, n, B, null,0,null,null, Math387.EPS); } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!